﻿using DotNetCore.CAP;
using Microsoft.AspNetCore.Mvc;

namespace CAP事件总线.Controllers
{
    public class HomeController : Controller
    {

        private readonly ICapPublisher  _capPublisher;

        public HomeController( ICapPublisher capPublisher)
        {
            _capPublisher = capPublisher;
        }

        public IActionResult Index()
        {
            //发送消息
            _capPublisher.Publish("test.message", "我发出消息啦"); 

            return View();
        }

      
    }
}